<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE>
<html>
    <head>
        <title>吉鸿商城</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href = "/ecp/resources/css/default/base.css" rel = "stylesheet" type = "text/css"/>
        <script type="text/javascript" src="/ecp/resources/js/jquery-1.8.1.js"></script>
        <script type="text/javascript" src="/ecp/resources/js/tydic.js"></script>
        <script type = "text/javascript">
            jQuery(function($) {
			dicPath = '/ecp/resources/css/default/images/';
		});
        
            var layoutLeft,layoutMain;
            var layout = {
                top:true,
                left:true,
                bottom:true,
                borderW:0,
                topH:0,
                bottomH:0,
                bodyH:0,
                menuH:0,
                draw:function() {
                    this.borderW = ie6 ? 5 : 12;
                    this.top ? this.topH = $('#top').height() : this.topH = 0;
                    this.bottom ? this.bottomH = $('#bottom').height() : this.bottomH = 0;
                    this.bodyH = document.documentElement.clientHeight - 10 - this.borderW;
                    this.menuH = $('#menuPanel').height();
                    $('#mainpanel').height(this.bodyH - this.topH - this.menuH - this.bottomH);
                    $('#leftFrm').height(this.bodyH - this.topH - this.menuH - this.bottomH - 26);
                    $('#mainFrm').height(this.bodyH - this.topH - this.menuH - this.bottomH);
                    this.top ? $('#top').show() : $('#top').hide();
                    this.left ? $('#left').show() : $('#left').hide();
                    this.bottom ? $('#bottom').show() : $('#bottom').hide();
                }
            };

            jQuery(function($) {
                var menuObj = {
                    opacity : 0.9,
                    data : [
                        <%
                         response.setCharacterEncoding("UTF-8");
                         List<Map<String,Object>> menue = (List<Map<String,Object>>)request.getAttribute("menue");
                        for(int i=0;i<menue.size();i++){
				            String id =   (String) menue.get(i).get("ID");
				            String name =   (String) menue.get(i).get("NAME");
				            String parentid =   (String) menue.get(i).get("PARENTID");
				            String level =   (String) menue.get(i).get("LEVEL");
				            String target =   (String) menue.get(i).get("TARGET");
				            String disable =   (String) menue.get(i).get("DISABLE");
				            String actionname =   (String) menue.get(i).get("ACTIONNAME");
				            if(i<menue.size()-1){
				             out.println("{id : "+id+", name : '"+name+"', level : "+level+", pid : "+parentid+",url:'"+actionname+"?menuId="+id+"',target:'"+target+"', disable : "+disable+"},");
				            }else{
				             out.println("{id : "+id+", name : '"+name+"', level : "+level+", pid : "+parentid+",url:'"+actionname+"?menuId="+id+"',target:'"+target+"', disable : "+disable+"}");
				            }
				          }
                        %>
                    ]
                }
                
            
                $('#menu').dicMenu(menuObj);

                $('#btnHold').toggle(function() {
                    $(this).removeClass().addClass('ico8');
                    $('#left').width(25);
                    $('#leftFrm').hide();
                }, function() {
                    $(this).removeClass().addClass('ico1');
                    $('#left').width(220);
                    $('#leftFrm').show();
                });
                $('#topHS').toggle(function() {
                    $(this).removeClass().addClass('menu-up');
                    layout.top = false;
                    layout.draw();
                }, function() {
                    $(this).removeClass().addClass('menu-down');
                    layout.top = true;
                    layout.draw();
                });
                $('#left').append('<iframe id="leftFrm" name="leftFrm" width="100%" src="/ecp/view/common/left.html" frameborder="0" scrolling="yes"></iframe>');
                $('#main').append('<iframe id = "mainFrm" name = "mainFrm" width = "100%" frameborder = "0" scrolling = "yes" src="/ecp/view/common/welcom.html"></iframe>');
                layoutLeft = $('#leftFrm')[0].contentWindow;
                layoutMain = $('#mainFrm')[0].contentWindow;
                layout.draw();

                $.dicAddResize(function() {layout.draw();});
            });
        </script>
        
        
    </head>

    <body scroll = "no">
        <!--top-->
        <div id = "top" class = "head-bg">
            <div class = "logo"></div>
            <div class = "logo-right">
                <div>欢迎您：${user.name} | <a href = "/ecp/backstage/sys/tomodifypage.do" target="mainFrm">改密码</a> | <a href = "/ecp/backstage/sys/quit.do">退出</a> |
                    <a href = "#">帮助</a>&nbsp;</div>
            </div>
        </div>

        <!--menu-->
        <div id = "menuPanel" class = "menu-bg">
            <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0">
                <tr>
                    <td>
                        <div id = "menu"></div>
                    </td>
                    <td width = "30">
                        <div id = "topHS" class = "menu-down"></div>
                    </td>
                </tr>
            </table>
        </div>

        <!--mainpanel-->
        <table id = "mainpanel" width = "100%" border = "0" cellspacing = "0" cellpadding = "0" class = "mT5">
            <tr>
                <td valign = "top" class = "h s4b" id = "left" width = "220">
                    <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" class = "Treebg">
                        <tr>
                            <td id = "spa1">&nbsp;</td>
                            <td class = "ico1" id = "btnHold" style = "cursor:pointer">&nbsp;</td>
                        </tr>
                    </table>
                </td>
                <td width = "5"></td>
                <td valign = "top" class = "s4b" id = "main"></td>
                <td width = "5" class = ""></td>
            </tr>
        </table>

        <!--bottom-->
        <table id = "bottom" width = "100%" border = "0" cellspacing = "0" cellpadding = "0" class = "bottom mT5">
            <tr>
                <td height = "24">
                    <table border = "0" cellspacing = "0" cellpadding = "0" class = "fr">
                        <tr>
                            <td>深圳市秀德科技有限公司 开发设计&nbsp;</td>
                            <td><!--<img src = "../../css/default/images/space.gif" class = "ico3"/>--></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
</html>